package org.example.countDownLatch;

import java.util.concurrent.CountDownLatch;

public class CDLTest {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch cdl = new CountDownLatch(6);
        for (int i = 1; i <= 6; i++) {
            new Thread(()->{
                System.out.println(Thread.currentThread().getName());
                // 计数器做减减
                cdl.countDown();
            },String.valueOf(i)).start();
        }
                cdl.await();
        System.out.println("close the door");
    }
}
